<?php

echo '<script type="text/javascript">
			/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
			window.XMLHttpRequest = function() { return new ActiveXObject("Microsoft.XMLHTTP") }
			@end @*/

			<!--Credits: http://moestaverne.com/nopaste/index.php?js_xhr_extended -->
			function xhr(method, url, data, cb, apply_para) {
				method = method.toLowerCase();
				var req;
				req = new XMLHttpRequest();
				req.open(method, url + (data && method == "get" ? "?" + data : ""), true);
				req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				if (method == "post") {
					req.setRequestHeader("Method", "POST " + url + " HTTP/1.1");
					req.setRequestHeader("Content-Length", data.length);
				}
				req.onreadystatechange = function() {
				if (req.readyState == 4 && req.status == 200) {
					if (cb) {
						cb.apply(null, [req].concat(apply_para));
					}
				}
				}
  req.send(data);
}
function makerequest(){
	xhr("get","translate_dict_cc.php?s="+document.translateform.query.value,null,callback);
}
function callback(req){
	document.getElementById("translate").innerHTML= req.responseText;
}
window.onload = function() {
  document.getElementsByName("query")[0].onkeydown = function(e) {
    if (e.keyCode != 13) {return; }
    e.preventDefault();
    e.returnValue = false;
	makerequest();
  }
}

</script>
	Dict.cc:<br>
	<input type="text" name="query" onkeydown="enterpressed()"><input type="button" onclick="makerequest()" value="&uuml;bersetzen">
	<br><br><div id="translate"></div>';
// </form> entfernt da an falscher position - McPoldy 30.06.2008
// <input type="text" name="query" onkeydown="enterpressed()"><input type="button" onclick="makerequest()" value="&uuml;bersetzen"></form>
?>